import sys 
from pathlib import Path
import requests

under =[]

fc=str(Path(sys.argv[1]).absolute()).split('/')[-2]
location={
'BJ':'北京',
'FZ':'福州',
'ZZ':'郑州',
'SH':'上海',
'CS':'长沙',
'GZ':'广州'

}


with open(sys.argv[1],'r',encoding='gbk')as f1:
    for line in f1:
        if line.startswith("样本"):continue
        line=line.strip().split('\t')
        if float(line[16])<=90:
            print(f"{line[0]}\tq30 under 90 !")
            under.append(f"{line[0]}     (Q30={line[16]}) ")
#url="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=c1436647-522c-4647-8140-5cb12df9475e"
url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=90434457-2bc2-45f4-8c5d-4c781ec72314"
header=f"{location['GZ']}{fc}以下样本Q30低于90！\n"

if len(under)==0:
    pass

else:
    contents="\n".join(under) 
    send_contents=header+contents
    data = {"msgtype": "text", "text": {"content":send_contents,}}
    # r = requests.post(url, json=data)       
